//
//  YMTextField.swift
//  YDOAProduct
//
//  Created by YDWY on 2017/6/17.
//  Copyright © 2017年 Allen. All rights reserved.
//

import UIKit

class YMTextField: UITextField {

    override func leftViewRect(forBounds bounds: CGRect) -> CGRect {
        var rect = super.leftViewRect(forBounds: bounds)
        rect.origin.x = 16 // 要往右偏多少根据自己需求，改变这个数字就好
        return rect
    }
    override func textRect(forBounds bounds: CGRect) -> CGRect {
        var rect = super.textRect(forBounds: bounds)
        rect.origin.x = 50 // 要往右偏多少根据自己需求，改变这个数字就好
        return rect
    }
    override func editingRect(forBounds bounds: CGRect) -> CGRect {
        var rect = super.editingRect(forBounds: bounds)
        rect.origin.x = 50 // 这个数字与textRect相同
        return rect
    }

}
